<template>
  <div class="app-container">
    <el-table ref="table" v-loading="listLoading" :data="list" border stripe style="width: 100%;" height="715">
      <el-table-column label="服务器" prop="sname" width="100px" align="center"></el-table-column>
      <el-table-column label="联盟ID" prop="union_id" width="100px" align="center"></el-table-column>
      <el-table-column label="联盟名称" prop="union_name" width="130px" align="center"></el-table-column>
      <el-table-column label="操作类型" prop="type" width="100px" align="center"></el-table-column>
      <el-table-column label="原内容" prop="original_content" width="350px" align="center"></el-table-column>
      <el-table-column label="修改内容" prop="new_content" width="350px" align="center"></el-table-column>
      <el-table-column label="操作时间" prop="create_dt" width="140px" align="center"></el-table-column>
      <el-table-column label="操作人" prop="create_user" width="100px" align="center"></el-table-column>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
  </div>
</template>

<script>
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import { getUnionLog } from '@/api/gm'
export default {
  name: 'UnionLog',
  components: { Pagination },
  data() {
    return {
      list: [],
      total: 0,
      listLoading: false,
      listQuery: {
        page: 1,
        limit: 200
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const query = this.listQuery
      this.listLoading = true
      const res = await getUnionLog(query)
      this.listLoading = false
      this.list = res.data.items
      this.total = res.data.total
    }
  }
}

</script>
